home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 8 / Night Owl CD-ROM (NOPV8) (Night Owl Publisher) (1993).ISO / 034a / tuthex.arj / TUTHEX2.TXT < prev    next >
Text File  |  1992-05-11  |  3KB  |  59 lines

  1. TUTORIAL "HEXING 101" PART 2
  2. What is DEBUG.COM? Well, it is a file located with all of
  3. your DOS files (it comes with DOS).  Look for it in the
  4. subdirectory where all your DOS files are kept, then copy it
  5. into your SWOTL\AC subdirectory.  Debug allows you alter the
  6. interior contents of a file (among other things).  To use it,
  7. we are mainly concerned about 3 commands: E (for edit) W
  8. (write the changes to the file) and Q (quit debugging).  The
  9. way to use it is at the DOS prompt > type DEBUG (filename),
  10. then press enter.  You will then see a "-", which is the
  11. "prompt" for debug.  A sample would be:
  12.      DEBUG FW190.SPC                         <ENTER>
  13.      E 100 54 41 20 31 35 32 00 00 00 00     <ENTER>
  14.      W                                       <ENTER>
  15.      Q                                       <ENTER>
  16. Were you to do this, you would change the name of the plane
  17. in the weapons menu to "TA 152"  Go ahead and try it, then
  18. let's discuss what happened.  The E command tells debug to
  19. edit the file named when you activated debug, ie the
  20. FW190.SPC file.  The first 3 numbers is the "address", ie
  21. that is where the edit command begins making the changes, at
  22. that spot.  100 happens to be the very beginning of the file.
  23. (in PCTools, this is equal to the location that has (0000) as
  24. the identifier)  The next 10 pairs of numbers are "bytes", ie
  25. each pair = 1 byte.  A byte can have any value from 00 to FF
  26. (hexidecimal to be explained soon).  In hex, the value 54 =
  27. to the letter T (in ASCII) and the value of 41 = A, so that's
  28. where the TA comes from.  The main program knows to use the
  29. letters instead of the strict numerical value here.  The 20 =
  30. a "blank space" in ASCII, and 30 - 39 are equal to the
  31. numbers 0 through 9 in hex.  So what we did was told the
  32. debug to make the change to the SPC file, TA "blank" 152 "no
  33. value" "no value" "no value" "no value".  Why the 4 "no
  34. values?"  To blank over the original name, which is FW 190 A-
  35. 8, which is ten bytes long.
  36. You need to get a chart that lists all the hexidecimal to
  37. ASCII equivalents, ie 41 = A, 61 = a, etc.  This will help.
  38. THINKING IN HEXIDECIMAL.  We use base 10 as our number
  39. system.  Computers use base 16, because it is a power of 2.
  40. (because of binary, I think).  So just as we have our ones,
  41. tens, and hundreds, hexidecimal has ones, sixteens, and 256s.
  42. The "numbers" in hexidecimal go like this:
  43. 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F  -therefore A=10 B=11 C=12
  44. and F=15.  So a byte location with 0C = 12. A byte location
  45. with 0F = 15. The number 25 would be written as 19 in
  46. hexidecimal, 16x1 plus 1x9 = 25.  The value of FA in hex is
  47. 250 in decimal (16 x F = 240, plus 1 x A = 10; add for 250)
  48. NOW IT GETS A LITTLE TRICKY.  The hex values sometimes are
  49. for only one byte, but sometimes two bytes are taken as a
  50. pair for numbers that are above 255 large.  For example, 300
  51. rounds of ammo would be 2C 01.  2=32 (16x2) C=12 (1x12) 0=0
  52. (4096x0) 1=256 (256x1).  32+12+256 = 300.  It is just like a
  53. decimal number, but the ones, tens, hundreds and thousands
  54. columns are a little jumbled.  Here it is again:
  55.          2          C           0          1
  56.      (sixteens)   (ones)     (4096s)    (256s)
  57. I don't know why this is the order, Tom Philo posted why, but
  58. I've come to accept it (grin).  Next lesson: PCTools.
  59.